package net.cc.jsy.mapper;

import com.alibaba.fastjson.JSONObject;
import net.cc.jsy.entity.TableEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author jingshiyu
 * @date 2020.9.22 9:19:57
 * @desc
 */
@Mapper
public interface MdbDbMapper {
    @Select("${str}")
    Object getSql(@Param("str") String str);
    @Select("${str}")
    JSONObject getSqlObject(@Param("str") String str);
    @Select("${str}")
    List getSqlList(@Param("str") String str);
    @Select("SELECT  r.TABLE_NAME AS name FROM INFORMATION_SCHEMA.SYSTEM_TABLES l  INNER JOIN UCA_METADATA.TABLES r   ON( l.TABLE_NAME= r.ESCAPED_TABLE_NAME)   WHERE  TABLE_CAT = 'PUBLIC' AND TABLE_SCHEM = 'PUBLIC' AND TABLE_NAME  LIKE '%' ESCAPE '\\'")
    List<TableEntity> getAllTable();
    @Select("select * from  ${name}")
    List<Map<String,Object>> getTableDetail(@Param("name") String name);
}
